package br.com.salaodebeleza.domain;

// Generated 26/11/2012 17:38:47 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TbGrupo generated by hbm2java
 */
@Entity
@Table(name = "tb_grupo", schema = "public")
public class TbGrupo implements java.io.Serializable {

	private long id;
	private String nome;
	private String ativo;
	private Set<TbUsuario> tbUsuarios = new HashSet<TbUsuario>(0);
	private Set<TbMenu> tbMenus = new HashSet<TbMenu>(0);
	private Set<TbMenuBotao> tbMenuBotao = new HashSet<TbMenuBotao>(0);

	public TbGrupo() {
	}

	public TbGrupo(long id, String nome, String ativo) {
		this.id = id;
		this.nome = nome;
		this.ativo = ativo;
	}
	
	public TbGrupo(long id, String nome, String ativo,
			Set<TbUsuario> tbUsuarios, Set<TbMenu> tbMenus) {
		this.id = id;
		this.nome = nome;
		this.ativo = ativo;
		this.tbUsuarios = tbUsuarios;
		this.tbMenus = tbMenus;
	}

	@Id
	@GeneratedValue
	@Column(name = "ID", unique = true, nullable = false, precision = 22, scale = 0)
	public long getId() {
		return this.id;
	}

	public void setId(long id) {
		this.id = id;
	}

	@Column(name = "NOME", nullable = false, length = 50)
	public String getNome() {
		return this.nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	@Column(name = "ATIVO", nullable = false, length = 1)
	public String getAtivo() {
		return this.ativo;
	}

	public void setAtivo(String ativo) {
		this.ativo = ativo;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tbGrupo")
	public Set<TbUsuario> getTbUsuarios() {
		return this.tbUsuarios;
	}

	public void setTbUsuarios(Set<TbUsuario> tbUsuarios) {
		this.tbUsuarios = tbUsuarios;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "tb_grupo_menu", schema = "public", joinColumns = { @JoinColumn(name = "grupo", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "menu", nullable = false, updatable = false) })
	public Set<TbMenu> getTbMenus() {
		return this.tbMenus;
	}

	public void setTbMenus(Set<TbMenu> tbMenus) {
		this.tbMenus = tbMenus;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "tb_grupo_menu_botao", schema = "public", joinColumns = { @JoinColumn(name = "grupo", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "menu_botao", nullable = false, updatable = false) })
	public Set<TbMenuBotao> getTbMenuBotao() {
		return tbMenuBotao;
	}

	public void setTbMenuBotao(Set<TbMenuBotao> tbMenuBotao) {
		this.tbMenuBotao = tbMenuBotao;
	}
	
	

}
